<template>
  <!-- 出铝量 -->
  <a-card :bordered="false">
    <!-- 查询区域 -->
    <div class="table-page-search-wrapper">
      <a-form layout="inline" @keyup.enter.native="searchQuery">
        <a-row :gutter="24">
          <a-col :xl="6" :lg="7" :md="8" :sm="24">
            <a-form-item label="模型名称">
              <j-input placeholder="请输入模型名称" v-model="queryParam.name"></j-input>
            </a-form-item>
          </a-col>
          <a-col :md="6" :sm="24">
            <a-form-item label="槽号">
              <a-select show-search placeholder="请选择槽号" v-model="queryParam.dataSoltIds">
                <a-select-option v-for="item in slotIdList" :key="item" :value="item">
                  {{ item }}
                </a-select-option>
              </a-select>
            </a-form-item>
          </a-col>
          <a-col :xl="4" :lg="7" :md="8" :sm="24">
            <span style="float: left; overflow: hidden" class="table-page-search-submitButtons">
              <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
              <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置 </a-button>
            </span>
          </a-col>
        </a-row>
      </a-form>
    </div>
    <!-- 查询区域-END -->
    <!-- table区域-begin -->
    <div>
      <a-table
        ref="table"
        size="middle"
        bordered
        rowKey="id"
        class="j-table-force-nowrap"
        :scroll="{ x: true }"
        :columns="columns"
        :dataSource="dataSource"
        :pagination="ipagination"
        :loading="loading"
        @change="handleTableChange"
      >
        <span slot="action" slot-scope="text, record">
          <a @click="handleEdit(record)">预测</a>
        </span>
      </a-table>
    </div>
     <aluminium-forecast ref="modalForm"></aluminium-forecast>
  </a-card> 
</template>

<script>
import '@/assets/less/TableExpand.less'
import AluminiumForecast from './AluminiumForecast'
export default {
  name: 'DataSetBuild',
  components: {
    AluminiumForecast
  },
  data() {
    return {
      description: '出铝量',
      slotIdList: [],
      // 表头
      columns: [
        {
          title: '#',
          dataIndex: '',
          key: 'rowIndex',
          width: 60,
          align: 'center',
          customRender: function (t, r, index) {
            return parseInt(index) + 1
          },
        },
        {
          title: '模型名称',
          align: 'center',
          dataIndex: 'modelName',
          width: 200,
        },

        {
          title: '槽号',
          align: 'center',
          dataIndex: 'slotNo',
          width: 200,
        },
        {
          title: '输入天数',
          align: 'center',
          dataIndex: 'days',
          width: 150,
        },
        {
          title: '训练人',
          align: 'center',
          dataIndex: 'create',
          width: 200,
        },
        {
          title: '训练日期',
          align: 'center',
          dataIndex: 'createTime',
          width: 200,
        },
        {
          title: '备注',
          align: 'center',
          dataIndex: 'remark',
        },
        {
          title: '操作',
          dataIndex: 'action',
          align: 'center',
          fixed: 'right',
          width: 160,
          scopedSlots: { customRender: 'action' },
        },
      ],
      url: {
        list: '/userReports/userReports/list',
        delete: '/dataSet/dataSet/delete',
        deleteBatch: '/userFormula/userFormula/deleteBatch',
        exportXlsUrl: '/userFormula/userFormula/exportXls',
        importExcelUrl: 'userFormula/userFormula/importExcel',
      },
      dictOptions: {},
      superFieldList: [],
      queryParam: {},
      dataSource: [
        {
          modelName: '2236-50',
          slotNo: '2236',
          days: '50',
          create: 'admin',
          createTime: '2024-01-01',
          remark: '--',
        },
        {
          modelName: '2236-10',
          slotNo: '2236',
          days: '10',
          create: 'admin',
          createTime: '2024-02-01',
          remark: '--',
        },
      ],
      visible:true
    }
  },
  created() {},
  computed: {},
  methods: {
    initDictConfig() {}, 
    handleEdit(record) {
      this.$refs.modalForm.show(record)
    }, 
  },
}
</script>
<style scoped>
@import '~@assets/less/common.less';
</style>